<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%--
The taglib directive below imports the JSTL library. If you uncomment it,
you must also add the JSTL library to the project. The Add Library... action
on Libraries node in Projects view can be used to add the JSTL 1.1 library.
--%>
<%--
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
--%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%
if(session.getAttribute("un")!=null){
    session.invalidate();
}
%>
<script language="javascript" type="text/javascript" src="../script/validate.js"></script>
<script language="javascript">
    function kiemtra(){
        var username = document.form1.txtusername;
        var pass = document.form1.txtpass;
        if( laChuoiRong(username.value))
	{
            alert('Username is not blank!');
            username.focus();
            return false;
	}
        if( laChuoiRong(pass.value))
	{
            alert('Password is not blank!');
            pass.focus();
            return false;
	}
        if(pass.value.length<6)
        {
            alert('Password must be 6 characters or more!');
            pass.focus();
            return false;
	}
        if(username.value.length<4){
            alert('Password must be 4 characters or more!');
            username.focus();
            return false;
        }
    }
</script>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Login</title>
    </head>
    <body>
        <form action="../controllLogin" method="post" name="form1" onsubmit="return kiemtra()">
            <table>
                <tr align="center">
                    <td ></td>
                    <td><h3>Login</h3></td>
                </tr>
                <tr>
                    <td>User name: </td>
                    <td><input type="txt" name="txtusername" value="" /></td>
                </tr>
                <tr>
                    <td>Password: </td>
                    <td><input type="password" name="txtpass" value="" size="20" /></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input type="submit" name="btlogin" value="Login" /></td>
                </tr>
            </table>
        </form>
    </body>
</html>
